<style>
.form-group{
	width:100%;
}
.form-control {
	position: relative;
	margin-bottom: 10px;
	font-size: 14px;
	width:100%;
	padding: 10px;
	-webkit-box-sizing: border-box;
   	-moz-box-sizing: border-box;
        box-sizing: border-box;
}
.form-control:focus {
  z-index: 2;
}
.form-control input[type="text"] {
  margin-bottom: -1px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.starter-template {
	  text-align: center;
	}
</style>
<div class="starter-template">
<form class="navbar-form navbar-center" role="form">
	<div class="form-group">
		<input type="text" id="stock_code" name="stock_code" class="form-control" maxlength="20" placeholder="<#if folder??><#if folder.name??>${folder.name}</#if><#else>000001</#if>" autofocus />
	</div>
		<button id="search" name="search" type="button" class="btn btn-lg btn-primary" >分析一下</button>
</form>
<strong for="stock_code" class="help-block" style="color:red;" id="help_tip"></strong>
</div>
<script>
$(function(){
	 $('#search').click(function(){
		 var codeId=$('#stock_code').val();
		 $.post("${basePath}/search.json",{'codeId':codeId},function(data){
				if(data.result){
					window.location.href = "${basePath}"+data.t;
				}else{
					$("#help_tip").html("找不到你要搜索的股票"+codeId+"相关图表");
				}
		},"json");
		
	 });
});
</script>